export const loginRouterName = 'login'
export const homeRouterName = 'home'
export const notFoundRouterName = '404'
export const serverErrorRouterName = '500'
export const profileRouterName = 'profile'

export const routerPathMap = {
    'sys/user': () => import('@/views/sys/user/index.vue'),
    'sys/role': () => import('@/views/sys/role/index.vue'),
    'sys/menu': () => import('@/views/sys/menu/index.vue'),
    'sys/dept': () => import('@/views/sys/dept/index.vue'),
    'sys/dict': () => import('@/views/sys/dict/index.vue'),
    'dev/generator': () => import('@/views/dev/generator/index.vue'),
}

const routes = [
    {
        path: '/',
        name: 'index',
        redirect: '/home'
    },
    {
        path: '/home',
        name: homeRouterName,
        component: () => import('@/views/Home.vue'),
        children: [
            {
                path: '/profile',
                name: profileRouterName,
                component: () => import('@/views/Profile.vue')
            },
        ]
    },
    {
        path: '/login',
        name: loginRouterName,
        component: () => import('@/views/Login.vue')
    },
    {
        path: '/500',
        name: serverErrorRouterName,
        component: () => import('@/views/500.vue')
    },
    {
        path: '/:pathMatch(.*)*',
        name: notFoundRouterName,
        component: () => import('@/views/404.vue')
    }
]

export default routes